import { request } from '@/utils/request.util';
import type { Pagination } from '@/types/pagination';
import type { Response, Res } from '@/types/common';
import type {
  RegistrationConfigForm,
  ScheduleResponse,
  ScheduleDataResponseForm,
  ShiftFrom,
  ShiftRole,
  SchedulingRole,
  CopyRegisration,
  RangeForm,RangeResponse,ShiftResponse,RegistrationConfigFormData
  
} from '@/types/registrationSettings/index.ts';

//查询挂号设置
export const getDoctorDict = () =>
  request.get<RegistrationConfigForm>('/emp/schedule/getDoctorDict');

//保存挂号设置
export const saveDict = (body: RegistrationConfigFormData) =>
  request.post<Response<Res>>('/emp/schedule/saveDict', body);

//查询员工排班列表
export const getEmpScheduleList = (body: ScheduleDataResponseForm) =>
  request.get<ScheduleResponse>('/emp/schedule/getEmpScheduleList', {
    params: body,
  });

//查询班次列表
export const getShiftList = (body: ShiftFrom) =>
  request.get<ShiftResponse>('/emp/schedule/getShiftList', {
    params: body,
  });

//新增班次
export const addShift = (body: ShiftRole) =>
  request.post<Response<Res>>('/emp/schedule/addShift', body);

//编辑班次
export const updateShift = (body: ShiftRole) =>
  request.post<any>('/emp/schedule/updateShift', body);

//删除班次
export const deleteShift = (shiftId: number) =>
  request.post<any>('/emp/schedule/deleteShift', { shiftId });

//排班维护
export const saveSchedule = (body: SchedulingRole) =>
  request.post<any>('/emp/schedule/saveSchedule', body);

//复制排班
export const copySchedule = (body: CopyRegisration) =>
  request.post<any>('/emp/schedule/copySchedule', body);

//修改排班查询需要退号的列表

export const getCancelRegisterList = (body: RangeForm) =>
  request.post<RangeResponse>('/clinic/register/getCancelRegisterList', body);

//退号
  
export const cancelRegister = (body: any) =>
  request.post<any>('/clinic/register/cancelRegister', body);
